<?php
declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Menu extends Model
{
    protected $table = 'system_menus';
    protected $dateFormat = 'U';
    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';
    const DELETED_AT = 'delete_time';

    public function roles()
    {
        return $this->belongsToMany(Role::class, 'system_role_menu', 'menu_id', 'role_id')->using(RoleMenu::class);
    }
}
